![]() |
PBReadForkSync |
||||
Header: | Files.h | Carbon status: | Supported | |
Reads data from an open fork.
OSErr PBReadForkSync ( FSForkIOParam *paramBlock );
A pointer to a parameter block.
A result code.
The relevant fields of the parameter block are:
On input, a pointer to a completion routine.
On output, the result code of the function. If there are fewer than requestCount bytes from the specified position to the logical end-of-file, then all of those bytes are read, and eofErr is returned.
On input, the reference number of the fork to read from.
On input, the base location for the start of the read.
On input, the offset from base location for the start of the read.
On input, the number of bytes to read.
A pointer to the buffer where data will be returned.
On output, the number of bytes actually read. This parameter is optional; if you don’t want it, set actualCount to NULL. The actualCount should be equal to requestCount unless there was an error during the read operation.
The fork to be read should have been previously opened using the FSOpenFork call. Data is read starting at the position specified by positionMode and positionOffset. Up to requestCount bytes will be read into the buffer pointed at by the buffer parameter.
The fork’s current position is set to point immediately after the last byte read (that is, the initial position plus actualCount).
The caller can hint to the File Manager whether the data being read should or should not be cached by setting the appropriate bits in positionMode. (This is the same behavior as PBReadSync.) See
You may also add forceReadMask to positionMode. This tells the File Manager to force the data to be read directly from the disk. This is different from noCacheMask since forceReadMask will flush the appropriate part of the cache first, then ignore any data already in the cache. However, data that is read may be placed in the cache for future reads. The forceReadMask is also passed to the device driver, indicating that it should avoid reading from any device caches.
To verify that data previously written has been correctly transferred to disk, read it back in using forceReadMask and compare it with the data you previously wrote.
Supported in Carbon. Available in Mac OS 9, and later when Carbon 1.0.2 or later is present.
© 2000 Apple Computer, Inc. — (Last Updated 5/8/2000)